package systemModel

import (
	"CommonsProject/models/commonsModel"
)

type SysRouter struct {
	commonsModel.Model
	Title         string `from:"title" json:"title" gorm:"column:title;size:20;comment:菜单名称"`
	Icon          string `from:"icon" json:"icon" gorm:"column:icon;size:20;comment:菜单图标"`
	IsMenu        bool   `from:"isMenu" json:"isMenu" gorm:"column:is_menu;size:1;comment:是否为菜单"`
	Url           bool   `from:"url" json:"url" gorm:"column:url;size:50;comment:url"`
	ParentId      uint   `from:"parenId" json:"parentId" gorm:"column:parent_id;comment:上级ID"`
	ComponentPath string `from:"componentPath" json:"componentPath" gorm:"column:component_path;size:150;comment:路由地址"`

	//多对多
	SysUsers []*SysUser `json:"sysUsers" gorm:"many2many:sys_user_router"`
}

func (u SysRouter) TableName() string {
	return "sys_router"
}
